package app.kotlin_1.activity;

import android.content.Intent;
import android.view.View;
import android.widget.Toast;

import app.kotlin_1.R;
import app.kotlin_1.base.BaseActivity;
import app.kotlin_1.view.SplashView;

/**
 * Created by 刘智强 on 2017/10/24.
 */

public class AppStartActivity extends BaseActivity implements SplashView.OnSplashListener {
    private SplashView splashView;

    @Override
    public int getlayoutId() {
        return R.layout.activity_app_start;
    }

    @Override
    public void getData() {

    }

    @Override
    public void initData() {

    }

    @Override
    public void initView() {
        splashView = (SplashView) findViewById(R.id.svSplash);
        splashView.setUrl("http://pic71.nipic.com/file/20150707/11135325_162943209000_2.png");
        splashView.setTime(6000);
        splashView.setDelyTime(1000);
        splashView.startTimer();

    }

    @Override
    public void initListenter() {
        splashView.setOnSplashListener(this);

    }

    @Override
    public void requestData() {

    }

    @Override
    public void setData(Object any) {

    }

    @Override
    public void setOnClick(View v) {

    }

    @Override
    public void onClick() {
        goToMainActivity();

    }

    @Override
    public void onTimeFinish() {
        goToMainActivity();

    }

    @Override
    public void onClickImage() {
        Toast.makeText(AppStartActivity.this, "点击了背景图片", Toast.LENGTH_LONG).show();

    }

    /**
     * 跳转
     */
    private void goToMainActivity() {
        Intent intent = new Intent(AppStartActivity.this, MainActivity.class);
        startActivity(intent);
        finish();
    }
}
